package com.ruoyi.common.wrapper;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 通用请求返回封装Bean
 *
 * @Author: kfc
 */

@NoArgsConstructor
@Setter
@Getter
@ToString
public abstract class BaseResult<T> implements Serializable {
    /**
     * 接口返回状态码
     */
    private int code;
    /**
     * 返回信息
     */
    private String msg;
    /**
     *subCode
     */
    private int subCode;
    /**
     * subMsg
     */
    private String subMsg;
    /**
     * 返回报文体
     */
    private T data;

    @JsonIgnore
    public boolean isSuccess(){
        return 200 == this.code;
    }
}
